#include<cstdlib>
#include<iostream>
#include <memory>
#include <crtdbg.h> 
using namespace std;
class stock1
{
public:
	void Buy()
	{
		cout<<"Buy Stock1"<<endl;
	}
	void Sell()
	{
		cout<<"Sell Stock1"<<endl;
	}
};

class stock2
{
public:
	void Buy()
	{
		cout<<"Buy Stock2"<<endl;
	}
	void Sell()
	{
		cout<<"Sell Stock2"<<endl;
	}
};

class stock3
{
public:
	void Buy()
	{
		cout<<"Buy Stock3"<<endl;
	}
	void Sell()
	{
		cout<<"Sell Stock3"<<endl;
	}
};
class stock4
{
public:
	void Buy()
	{
		cout<<"Buy Stock4"<<endl;
	}
	void Sell()
	{
		cout<<"Sell Stock4"<<endl;
	}
};
class Fund
{
public:
	Fund(){
		mpS1 = new stock1();
		mpS2 = new stock2();
		mpS3 = new stock3();
		mpS4 = new stock4();
	}
	~Fund()
	{
		delete mpS1;
		delete mpS2;
		delete mpS3;
		delete mpS4;
	}
	void BuyFund()
	{
		cout<<"__________________Buy Fund:__________________"<<endl;
		mpS1->Buy();
		mpS2->Buy();
		mpS3->Buy();
		mpS4->Buy();
		cout<<"__________________End of Buy Fund:__________________"<<endl;
	}
	void SellFund()
	{
		cout<<"__________________Sell Fund:__________________"<<endl;
		mpS1->Sell();
		mpS2->Sell();
		mpS3->Sell();
		mpS4->Sell();
		cout<<"__________________End of Sell Fund:__________________"<<endl;
	}
private:
	stock1* mpS1;
	stock2* mpS2;
	stock3* mpS3;
	stock4* mpS4;
};

int main()
{
	Fund* lpFund = new Fund();
	lpFund->BuyFund();
	lpFund->SellFund();

	getchar();
}